home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 2002 #4 / K-CD-4-2002.ISO / Empire Earth / EEDemo.exe / Disk1 / data.ssa / unit ai scripts_gather.tai < prev    next >
Encoding:
Text File  |  2001-09-29  |  2.5 KB  |  125 lines

  1. //
  2. // Gather AI file
  3. //
  4. // Behaviors:
  5. //
  6. //        If given an order to gather, continue to do so until there are no more resources within
  7. //                 the visibility map and wander range.
  8. //
  9. //    Notes:
  10. //
  11. //    Known Problems:
  12. //
  13.  
  14.  
  15. AddResourceToStorage
  16. {
  17.     StorageDestroyed true(FindNewStorage)
  18.     ResourceCapacityEmpty true(CheckPreviousResource)
  19. }
  20.  
  21. CheckForOpenPosition
  22. {
  23.     WaitingAreaInRange false(MoveToWaitingArea)
  24.     OpenPositionAvailable true(MoveToResource) false(WaitForOpenPosition)
  25. }
  26.  
  27. CheckPreviousResource
  28. {
  29.     ResourceDepleted true(FindNewResource) false(MoveToWaitingArea)
  30. }
  31.  
  32. // assumption here is that there are no more waypoints
  33. CheckResourceAccessibility
  34. {
  35.     ResourceAccessible true(GatherResource) false(FindNewResource)
  36. }
  37.  
  38. CheckResourceCapacity
  39. {
  40.     ResourceCapacityFilled true(FindStorage) false(FindNewResource)
  41. }
  42.  
  43. CheckStorageAccessibility
  44. {
  45.     StorageDestroyed true(FindNewStorage)
  46.     StorageInRange true(AddResourceToStorage) false(FindNewStorage)
  47. }
  48.  
  49. FindNewResource
  50. {
  51.     NewResourceFound true(MoveToWaitingArea) false(FindStorage)
  52. }
  53.  
  54. FindNewStorage
  55. {
  56.     ResourceCapacityEmpty true(Idle)
  57.     StorageFound true(MoveToStorage) false(Idle)
  58. }
  59.  
  60. FindStorage
  61. {
  62.     ResourceCapacityEmpty true(Idle)
  63.     StorageFound true(MoveToStorage) false(Idle)
  64. }
  65.  
  66. GatherResource
  67. {
  68.     ResourceDepleted true(CheckResourceCapacity)
  69.     ResourceCapacityFilled true(NotifyWaitingCitizen)
  70.     ResourceInRange false(PrepareToMove)
  71.     TakingLightDamage true(FleeDanger)
  72. }
  73.  
  74. MoveToResource
  75. {
  76.     ResourceInRange true(GatherResource) false(PrepareToMove)
  77. }
  78.  
  79. MoveToWaitingArea
  80. {
  81. // resurrected gather goals put us here
  82.     ResourceCapacityFilled true(MoveToStorage)
  83.     ResourceTargetIsTree true(MoveToResource)
  84.     WaitingAreaInRange true(CheckForOpenPosition) false(PrepareToMove)
  85. }
  86.  
  87. MoveToStorage
  88. {
  89.     StorageDestroyed true(FindNewStorage)
  90.     StorageInRange true(AddResourceToStorage) false(PrepareToMove)
  91. }
  92.  
  93. NotifyWaitingCitizen
  94. {
  95.     StorageDestroyed true(FindNewStorage) false(FindStorage)
  96. }
  97.  
  98. HasResourceGoal
  99. {
  100.  
  101.     ResourceTargetIsTree true(CheckResourceAccessibility)
  102.     ResourceDepleted true(FindNewResource)
  103.     ResourceInRange true(GatherResource) false(MoveToWaitingArea)
  104. }
  105.  
  106. ReacquireGoal
  107. {
  108.     GoalIsWaitingArea true(CheckForOpenPosition)
  109.     GoalIsStorage true(CheckStorageAccessibility)
  110.     GoalIsResource true(HasResourceGoal)
  111. }
  112.  
  113.  
  114. WaitForOpenPosition
  115. {
  116.     ImAFarmer true(FindFarm)
  117.     ResourceDepleted true(CheckResourceCapacity)
  118.     WaitingAreaInRange false(MoveToWaitingArea)
  119. }
  120.  
  121. FindFarm
  122. {
  123.     FarmNotFound true(WaitForOpenPosition)
  124. }
  125.